#include "Evas.h"
#include "Ender.h"
#include "efl_ender_evas.h"
/*============================================================================*
 *                                  Local                                     *
 *============================================================================*/
static Ender_Element * _evas_evas_rectangle_add(Evas *e)
{
	Ender_Element *ret;
	Ender_Descriptor *d;
	Evas_Object *o;

	/* FIXME we can avoid having to lookup for the
	 * descriptor by just keeping the pointer
	 * when created
	 */
	o = evas_object_rectangle_add(e);
	d = ender_namespace_descriptor_find(efl_ender_evas_namespace_get(), "object");
	ret = ender_descriptor_element_new_from_data(d, o);
	return ret;
}
/*----------------------------------------------------------------------------*
 *                           The Ender interface                              *
 *----------------------------------------------------------------------------*/
#define EVAS_EVAS_RECTANGLE_ADD EFL_ENDER_EVAS_RECTANGLE_ADD
#define evas_namespace_get efl_ender_evas_namespace_get
#define _evas_evas_new evas_new
#define _evas_evas_delete evas_free
#include "efl_ender_evas_generated.c"
/*============================================================================*
 *                                 Global                                     *
 *============================================================================*/
/*============================================================================*
 *                                   API                                      *
 *============================================================================*/
Ender_Function * EFL_ENDER_EVAS_RECTANGLE_ADD = NULL;

Ender_Namespace * efl_ender_evas_namespace_get(void)
{
	static Ender_Namespace *ns = NULL;

	if (!ns)
	{
		ns = ender_namespace_new("evas", 0);
	}
	return ns;
}

void efl_ender_evas_init(void)
{
	evas_init();
	ender_init();
	/* register all the classes/abstracts/etc */
	_evas_evas_init();
	/* now the other classes */
	efl_ender_evas_object_init();
}
